package com.leetcode.simple;

/**
 * 找出只出现一次的数字
 * @author Administrator
 */
public class AppearOnceTest {

    public static void main(String[] args) {
        int[] ints = {44, 1, 2, 222, 1, 2, 44, 5, 5, 6, 6, 3, 222};
        int anInt = ints[0];
        for (int i = 1; i < ints.length; i++) {
            int anInt1 = ints[i];
            System.out.println("--:" + anInt1);
            anInt = anInt ^ anInt1;
            System.out.println("---:" + anInt);
        }
        System.out.println("----:" + anInt);
    }
}
